package com.jk.bglog.controller;

import com.jk.bglog.entity.OrderLogEntity;
import com.jk.bglog.entity.UserInfoEntity;
import com.jk.bglog.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.List;

@RestController
@RequestMapping("test")
public class UserController {
    @Value("${server.port}")
    String port;
    @Autowired
    private UserService UserService;

    @RequestMapping("findTest")
    public Object test(String name){

        return "你好"+name +"你访问的端口号为"+port;
    }

    /**
     * 查询用户信息表
     * @param userInfoEntity
     * @return
     */
    @RequestMapping("queryUserInfo")
    public List<UserInfoEntity> queryUserInfo(UserInfoEntity userInfoEntity){

        return UserService.queryUserInfo(userInfoEntity);
    }

    /**
     * @description:  详情回显
     * @param: [id]
     * @return: com.jk.bglog.entity.UserInfoEntity
     * @author 刘杨彬
     * @date: 2021/9/2 21:05
     */
    @RequestMapping("queryOrderById")
    public OrderLogEntity queryOrderById(Integer id) {

        return UserService.queryOrderById(id);
    }




}
